import interfaceApi from '../api/urlListData.js';
import ajax from '../common/ajax.js';
//import template from '../common/template.js';

const state = true;




//数据初始化
function int() {
    getStudentInformation();
};
//获取学生信息
function getStudentInformation() {
    let postData = {
        // username: '张三',
        // password: 123456
    };
    ajax({
        url: state == true ? '../json/data.json' : interfaceApi.Api.indexStudent,
        postData:postData,
        type:'GET',
        dataType:'json',
        timeout:5000,
        succCallback:function(res){  //成功
            console.log(res)
            $('#xsBox').html(template('xsBoxTpl',{'res':res}));
            $('#indexExamination').html(template('indexExaminationTpl',{'res':res.data.dataList}));
            $('#newsList').html(template('newsListTpl',{'res':res.data.xiaoxi}));
           // processingPage(pdata);
        },
        errorCallback:function (res) {
            console.log(res)
        }
            
    });
};




//课表更多
$('.index-x-title-one').click(function () {
    window.location.href = "http://localhost:8022/demo/ajax.html"
});

//消息更多
$('.index-x-title-two').click(function () {
    window.location.href = "http://localhost:8022/demo/ajax.html"
});




int();
